package com.ed100.sass.threadpool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Demo2 {

	public static void main(String[] args) {
		ExecutorService executor = Executors.newCachedThreadPool();

		for (int i = 0; i < 5; i++) {
			TaskThread thread = new TaskThread();
			executor.execute(thread);
		}
		
		executor.shutdown();
	}
}

class TaskThread implements Runnable {

	@Override
	public void run() {
		System.out.println("正在执行 " + Thread.currentThread().getName());
	}

}
